﻿using IMeiWei.Model;
using IMeiWeiWebService.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace IMeiWeiWebService.Extensions
{
    public static class articleExtension
    {
        public static ArticleViewModel ToArticleViewModel(this article record, string pictureName)
        {
            return new ArticleViewModel()
            {
                Id = record.Id,
                ArticleTitle = record.ArticleTitle,
                ArticleLink = record.ArticleLink,
                PublishTime = record.PublishTime,
                ReadNo = record.ReadNo,
                ShareNo = record.ShareNo,
                ArticleStatus = record.ArticleStatus,
                CreateBy = record.CreateBy,
                CreateTime = record.CreateTime,
                PictureName = pictureName,
            };
        }
    }
}